package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.UserSignInLog;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author xuanqicheng
 * @create 2019-12-11:00
 */
@Repository
public class UserSignInLogDao {
    @Autowired
    private SqlSession sqlSession;
    public UserSignInLog selectSignLogByUserId(long userId) {
        return sqlSession.selectOne("selectSignLogByUserId",userId);
    }

    public void insert(UserSignInLog userSignInLog) {
         sqlSession.insert("addUserSignInLog",userSignInLog);
    }


    public int updateFirstDaySignIn(long userId) {
        int num=sqlSession.update("updateFirstDaySignIn",userId);
        return num;
    }

    public int updateSignIn(long userId) {
        int num = sqlSession.update("updateUserSignIn",userId);
        return num;
    }
}
